/**
 * Image 组件的主题配置
 */

import type { ComponentToken } from 'antd/es/image/style';

const Z_INDEX_TOKENS = {
  zIndexPopup: 1080,
} as const;

const PREVIEW_TOKENS = {
  previewOperationSize: 18,
  previewOperationColor: 'rgba(255, 255, 255, 0.65)',
  previewOperationHoverColor: 'rgba(255, 255, 255, 0.85)',
  previewOperationColorDisabled: 'rgba(255, 255, 255, 0.25)',
} as const;

export const imageThemeConfig: Partial<ComponentToken> = {
  zIndexPopup: Z_INDEX_TOKENS.zIndexPopup,
  previewOperationSize: PREVIEW_TOKENS.previewOperationSize,
  previewOperationColor: PREVIEW_TOKENS.previewOperationColor as any,
  previewOperationHoverColor: PREVIEW_TOKENS.previewOperationHoverColor as any,
  previewOperationColorDisabled: PREVIEW_TOKENS.previewOperationColorDisabled as any,
};

export const getImageTheme = (
  customConfig?: Partial<ComponentToken>
): Partial<ComponentToken> => {
  return {
    ...imageThemeConfig,
    ...customConfig,
  };
};

export type { ComponentToken as ImageComponentToken } from 'antd/es/image/style';

